package sis.ra.yahoor.result;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import sis.ra.utility.Utils;


public class test3 {

	public static void stem (String text, String htformat)
	{
		String linguistxpath="c:\\Program Files\\INXIGHT\\LinguistxPlatform3.7\\lx-3\\";

		Utils.writeFile(linguistxpath+"windows-2003-i686-msvc-7.1-32\\test.txt ", text);
		String s="";
		
		String cmd="\""+linguistxpath+"windows-2003-i686-msvc-7.1-32\\test_platform.exe\" -k 735442535d524e "+
		"-d " + "\""+linguistxpath + "lang\"" + 
		" -stem " +
		" -"+htformat+" " +"\"" +linguistxpath + "windows-2003-i686-msvc-7.1-32\\test.txt\" ";
		try {
//			System.out.println(cmd);
		     Process p = Runtime.getRuntime().exec(cmd);
		    
		    BufferedReader stdInput = new BufferedReader(new InputStreamReader(p.getInputStream()));
		    BufferedReader stdError = new BufferedReader(new InputStreamReader(p.getErrorStream()));
		    while ((s = stdInput.readLine()) != null)   
		    {
		    	System.out.println(s);		    
		    }
//		    while ((s = stdError.readLine())!=null)
//		    {
//		    	System.out.println(s);
//		    }
		}
		catch (IOException e) {
			    e.printStackTrace();    
		}
	}
	public static void main(String[] args) {
		stem("paid","text");

	}

}
